package cn.zhuama.basic.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class AjaxResult {
    private boolean success = true;
    private String message;
    private Object resultObj;

    public AjaxResult(boolean b, String 操作失败) {
    }
    public static AjaxResult me() {
        return new AjaxResult();
    }
    public AjaxResult setSuccess(boolean b) {
        this.success = b;
        return this;
    }
    public AjaxResult setMessage(String message) {
        this.message = message;
        return this;
    }
    public AjaxResult setObject(Object resultObj) {
        this.resultObj=resultObj;
        return this;
    }
    public AjaxResult(boolean b) {
        if(b){
            this.message="OK";
        }
        else {
            this.message="NO";
        }
    }
//    public static AjaxResult();

}
